package com.project.mapper.saleManagerMapper;

import com.project.bean.SaleOrderBean;
import com.project.bean.ShopCarBean;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.Collection;
import java.util.List;

/**
 * 销售出库mapper
 */
public interface ISaleOrderMapper {
    /**
     * 添加销售订单
     * @param salesOrder
     */
    public void addOrder(SaleOrderBean salesOrder);

    /**
     * 添加订单详情
     * @param saleOrderId
     * @param shopList
     */
    public void addOrderInfo(@Param("saleOrderId") int saleOrderId,
                             @Param("shopList") Collection<ShopCarBean> shopList);

    /**
     * 根据销售订单id查询详细信息
     * @param saleOrderId 销售订单id
     * @return 销售详情对象
     */
    public SaleOrderBean findById(int saleOrderId);

    /**
     * 动态查询订单信息
     * @param customerName 客户名称
     * @param startDate 起始日期
     * @param endDate 结束日期
     * @return 订单集合
     */
    public List<SaleOrderBean> findByItem(@Param("customerName") String customerName,
                                          @Param("startDate") LocalDate startDate,
                                          @Param("endDate") LocalDate endDate);

}
